package chapter7.test.no2;

public class Main {
    public static void main(String[] args) {
        A a=new A();
        a.f();
        System.out.println();
        a=new B();
        a.f();
        System.out.println();
        a=new C();
        a.f();
    }
}
class A{
    int f(){
        System.out.println("f-A");
        return 0;
    }
    A(){f();}
}
class B extends A{
    @Override
    int f() {
        System.out.println("f-B");
        return 0;
    }
    B(){
        super();
        super.f();
        System.out.println("B");
        f();
    }
}
class C extends A{
    @Override
    int f() {
        System.out.println("f-C");
        return 0;
    }
    C(){
        super();
        super.f();
        System.out.println("C");
        f();
    }
}

